import { getNestApiData } from "@/services/cpasRequest";
import { request } from "umi";

// // 获取附件属性
// export async function getFileProperties(dbname: string, fjid: string): Promise<any> {
//   const res = await request('/cpasApi/draftFjManage/getFileProperties', {
//     method: 'GET',
//     params: {
//       dbname: dbname,
//       fjid: fjid,
//     }
//   })
//   return res.data
// }


// 查询底稿该年度下重复
export async function queryDgmc(params: {
  dbname: string;
  dgnd: string;
  dgmc: string;
}) {
  try {

    const res = await request('/cpasApi/draftManage/queryDgmcExists', {
      method: 'GET',
      params
    })
    return Promise.resolve({
      data: res.data,
      msg: res.msg,
      success: res.data,
    });
  } catch (error) {
    return Promise.resolve({
      data: '接口/template/importTemplate,请求失败！',
      success: false,
    });
  }
}



// 查询底稿索引号是否在该年度下重复
export async function queryDgsyh(params: {
  dbname: string;
  dgnd: string;
  dgsyh: string;
}) {
  try {
    const res = await request('/cpasApi/draftManage/queryDgsyhExists', {
      method: 'GET',
      params
    })
    return Promise.resolve({
      data: res.data,
      msg: res.msg,
      success: res.data,
    });
  } catch (error) {
    return Promise.resolve({
      data: '接口/draftManage/queryDgsyhExists,请求失败！',
      success: false,
    });
  }
}

// 查询附件名称是否重复
export async function queryfjName(params: {
  dbname: string;
  fjName: string;
}) {
  try {
    const res = await request('/cpasApi/draftFjManage/checkFjName', {
      method: 'GET',
      params
    })
    return Promise.resolve({
      data: res.data,
      msg: res.msg,
      success: res.data,
    });
  } catch (error) {
    return Promise.resolve({
      data: '接口/draftManage/queryDgsyhExists,请求失败！',
      success: false,
    });
  }
}

// 